package com.yfp.operation.api;

import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result;
import com.yfp.common.core.constant.SecurityConstants;
import com.yfp.common.core.constant.ServiceNameConstants;
import com.yfp.common.core.domain.R;
import com.yfp.operation.api.factory.RemoteGroupFallbackFactory;
import com.yfp.operation.domain.EnterpriseVO;
import com.yfp.operation.domain.GroupRegisterBody;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * operation运营模块
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remoteGroupService", value = ServiceNameConstants.GROUP_SERVICE, fallbackFactory = RemoteGroupFallbackFactory.class)
public interface RemoteGroupService {

    @Operation(summary = "h5-注册账号", description = "企业注册账号接口")
    @PostMapping("/enterpriseUser/register")
    R<WxPayUnifiedOrderV3Result.JsapiResult> register(@RequestBody GroupRegisterBody groupRegisterBody, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @Operation(summary = "h5-获取用户信息", description = "登录后获取用户信息")
    @GetMapping("/enterpriseUser/info/{userId}")
    R<EnterpriseVO> getEnterpriseUserByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/enterpriseOrder/updateFinishTime")
    @Operation(summary = "修改取餐完成时间")
    public R<Void> updateFinishTime(@RequestParam("enterpriseOrderSn") String enterpriseOrderSn);
}
